﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using WeifenLuo.WinFormsUI.Docking;

namespace UI_Editor.DckForm
{
    public partial class PropForm : DockContent
    {
        private static PropertyGrid PropertyGrid;
        private static PropForm propForm;
        public static void SetObj(object obj, string name)
        {
            if(PropertyGrid != null) PropertyGrid.SelectedObject = obj;
            if(propForm != null) propForm.Text = name + " 属性";
        }

        public PropForm()
        {
            InitializeComponent();
            PropertyGrid = propertyGrid;
            propForm = this;
        }

        public void setSelected(object obj)
        {
            this.propertyGrid.SelectedObject = obj;
        }
    }
}
